import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '发布时间',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '用户',
    align:"center",
    dataIndex: 'userId'
   },
   {
    title: '回复哪条消息',
    align:"center",
    dataIndex: 'replyId'
   },
   {
    title: '图片',
    align:"center",
    dataIndex: 'img',
    customRender:render.renderImage,
   },
   {
    title: '文字',
    align:"center",
    dataIndex: 'content'
   },
   {
    title: '点赞数',
    align:"center",
    sorter: true,
    dataIndex: 'zanNum'
   },
   {
    title: '回复数',
    align:"center",
    sorter: true,
    dataIndex: 'repleNum'
   },
   {
    title: '是否置顶',
    align:"center",
    sorter: true,
    dataIndex: 'isTop_dictText'
   },
   {
    title: '是否推荐到游记',
    align:"center",
    sorter: true,
    dataIndex: 'isStrategy_dictText'
   },
   {
    title: '评论类别',
    align:"center",
    dataIndex: 'commentType_dictText'
   },
   {
    title: '租户',
    align:"center",
    dataIndex: 'tenantId_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "是否置顶",
      field: 'isTop',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"couple_is"
      },
      //colProps: {span: 6},
 	},
	{
      label: "是否推荐到游记",
      field: 'isStrategy',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"couple_is"
      },
      //colProps: {span: 6},
 	},
	{
      label: "评论类别",
      field: 'commentType',
      component: 'JDictSelectTag',
      componentProps:{
          dictCode:"sys_category,name,id"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户',
    field: 'userId',
    component: 'Input',
  },
  {
    label: '回复哪条消息',
    field: 'replyId',
    component: 'Input',
  },
  {
    label: '图片',
    field: 'img',
     component: 'JImageUpload',
     componentProps:{
      },
  },
  {
    label: '文字',
    field: 'content',
    component: 'Input',
  },
  {
    label: '是否置顶',
    field: 'isTop',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"couple_is"
     },
  },
  {
    label: '是否推荐到游记',
    field: 'isStrategy',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"couple_is"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}